﻿namespace SC.GridManage.API.Read.Extensions
{
    /// <summary>
    /// Grid Manage Service 扩展
    /// </summary>
    public static class GMServiceExtension
    {
        public static IServiceCollection AddGMService(this IServiceCollection services)
        {

            services.AddSwaggerGen(o => {
                o.IncludeXmlComments(AppContext.BaseDirectory + "/SC.GridManage.API.Read.xml");
            });
            return services;
        }
        /// <summary>
        /// 扩展方法 直接判断字符串是否非空
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static bool IsNullOrEmpty(this string str) {

            if (String.IsNullOrEmpty(str))
            {
                return true;
            }
            else {
                return false;
            }
        }
    }
}
